home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
libs
/
conlib.lha
/
ConLib
/
Asm_Stuff
/
Hello.asm
< prev
Wrap
Assembly Source File
|
1992-01-04
|
3KB
|
155 lines
;==================================================================
;===
;=== Name: Hello
;===
;=== Author: Bjørn Reese
;===
;=== This source is Public Domain.
;===
;==================================================================
;--- Comment ------------------------------------------------------
;
; TAB = 8 ; POINTER = ^
;
; A simple example of how to use "con.library".
;
;------------------------------------------------------------------
;--- System -------------------------------------------------------
INCDIR INCLUDE:
;--- Include ------------------------------------------------------
INCLUDE exec/exec_lib.i
INCLUDE intuition/intuition.i
INCLUDE work/con_lib.i ;or whereever you keep them.
INCLUDE work/con.i
;--- Macro --------------------------------------------------------
CALL: MACRO
jsr _LVO\1(a6)
ENDM
;==================================================================
;===
;=== CODE AREA
;===
;==================================================================
SECTION Reese,CODE
start:
;--- Open Con Library
move.l (_SysBase).w,a6
moveq #0,d0
lea sConName(pc),a1
CALL OpenLibrary
move.l d0,pConBase
;--- Open ConWindow (with cursor off)
move.l pConBase(pc),a6
lea dMyWindow(pc),a0
move.w #CURSOROFF,d0
CALL OpenCon
move.l d0,pConHandle
;--- Place the cursor
move.l pConHandle(pc),a0
moveq #30,d0
moveq #12,d1
CALL GotoXY
;--- Write a text
moveq #-1,d0
move.l pConHandle(pc),a0
lea sHello(pc),a1
CALL DisplayRaw
;--- Wait for keypressed
move.l pConHandle(pc),a0
move.l #ACCF_WAIT!ACCF_ECHO!ACCF_ERASE,d0
lea dKeypress(pc),a1
CALL Accept
;--- Close ConWindow
move.l pConBase(pc),a6
move.l pConHandle(pc),a0
CALL CloseCon
;--- Close Con Library
move.l (_SysBase).w,a6
move.l pConBase(pc),a1
CALL CloseLibrary
moveq #0,d0
rts
;==================================================================
;===
;=== DATA AREA
;===
;==================================================================
DataArea:
;--- Variable -----------------------------------------------------
pConBase dc.l 0
pConHandle dc.l 0
;--- Text ---------------------------------------------------------
sConName dc.b 'con.library',0
sWindowTitle dc.b '- Press any key -',0
sHello dc.b 'Hello Amiga dudes.',0
EVEN
;--- Table --------------------------------------------------------
cMyIDCMP SET CLOSEWINDOW
cMyFlags SET WINDOWSIZING!WINDOWDRAG!WINDOWDEPTH!WINDOWCLOSE
cMyFlags SET cMyFlags!SMART_REFRESH!ACTIVATE!NOCAREREFRESH
;--- Intuition NewWindow Structure
dMyWindow:
dc.w 0,11 ;LeftEdge, TopEdge
dc.w 640,245 ;Width, Height
dc.b 0,1 ;DetailPen, BlockPen
dc.l cMyIDCMP ;IDCMPFlags
dc.l cMyFlags ;Flags
dc.l 0,0 ;FirstGadget, CheckMark
dc.l sWindowTitle ;Title
dc.l 0 ;Screen
dc.l 0 ;BitMap
dc.w 30,30 ;MinWidth, MinHeight
dc.w -1,-1 ;MaxWidth, MaxHeight
dc.w WBENCHSCREEN ;Type
;--- AcceptStruct
dKeypress:
dc.w -1,-1 ;XStart,YStart
dc.w -1,-1,-1 ;Styles,FgCol,BgCol
dc.l CLOSEWINDOW ;ExitFlags
dcb.l 7,0 ;Message stuff
dc.b 0,0 ;Char,Pad001
dcb.b CHARDEFSIZE,-1 ;ValidTable
dcb.b CHARDEFSIZE,-1 ;ExitTable
dcb.l 4,0 ;Reserved